package com.lc.pianostudent.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2018/2/22.
 */
@HttpInlet(Conn.REGISTERNEXT)
public class PostRegisterNext extends BaseAsyPost {

    public String username, password,confirm_password,mouse,teacher,type,sex,year,cname;

    public PostRegisterNext(AsyCallBack asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected PostRegisterNextInfo parser(JSONObject object) throws Exception {
        if (object.optString("code").equals("200")) {

            PostRegisterNextInfo info = new PostRegisterNextInfo();

            info.code = object.optString("code");
            info.message = object.optString("message");
            info.user_id = object.optString("user_id");
            info.username = object.optString("username");
            info.name = object.optString("name");
            info.avatar = object.optString("avatar");
            info.person = object.optString("person");
            info.cname = object.optString("cname");
            info.teacherid = object.optString("teacherid");
            info.teacher = object.optString("teacher");
            TOAST = object.optString("message");
            return info;

        } else {

            TOAST = object.optString("message");

        }

        return null;
    }

    public static class PostRegisterNextInfo {

        public String code, message,user_id,username,cname,name,avatar,person,teacherid,teacher;

    }

}
